#!/usr/bin/env python
# -*- coding:utf-8 -*-
from django.conf.urls import url
from . import views

from rest_framework_jwt.views import obtain_jwt_token


urlpatterns = [

    # /users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.RegisterUserNameView.as_view(),name='usernamecount'),
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$',views.RegisterPhoneCountAPIView.as_view(),name='phonecount'),
    url(r"^$",views.RegisterUserView.as_view()),
    # url(r"^auths/",obtain_jwt_token),
    url(r'auths/',views.UserAuthorizationView.as_view(),name='auths'),
    url(r"^infos/$",views.UserInfoView.as_view()),
    url(r"^emails/$",views.EmailView.as_view()),
    # url(r"^list/$",views.UserListView.as_view())
    url(r"^emails/verification/$",views.EmailActiveView.as_view()),
    # /users/browerhistories/
    url(r"^browerhistories/$",views.UserBrowsingHistoryView.as_view())
]

from .views import AddressViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'addresses',AddressViewSet,base_name='address')
urlpatterns += router.urls

# {
#   "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Inp1b2d1b2NoZW4iLCJlbWFpbCI6IiIsInVzZXJfaWQiOjMsImV4cCI6MTUzOTY4MzA0NX0.
# gTp6AvywW-0_v7HVbXMywReSrgH6mzSkS5YifXJvlEM"
# }
# eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
# eyJlbWFpbCI6IiIsImV4cCI6MTUzOTY4NDI5MSwidXNlcm5hbWUiOiJ6dW9ndW9jaGVuIiwidXNlcl9pZCI6M30.
# -8q0BfK1Mb_VU64K7ACRa-B8SsIrXuA1AdX-sgvdBmA